{% extends "_layouts/index.html" -%}

{% block search -%}
{{ search::input(name="name", title="菜单名称", value=name)}}
{{ search::state(value=state)}}
{{ search::input(name="url", title="链接地址", value=url)}}
{{ search::yes_no(name="is_blank", title="是否外链", value=is_blank)}}
{% endblock search -%}

{% block options -%}
{{option::delete_all()}} {{option::add(height=550)}} 
{% endblock options -%}

{% block content -%}
<table class="layui-table layui-form">
<thead>
    <tr>
        <th style="width: 40px"> <input type="checkbox" name=""  lay-skin="primary"> </th>
        <th class="row-id">编号</th>
        <th>上级菜单</th>
        <th>菜单名称</th>
        <th>菜单级别</th>
        <th>状态</th>
        <th>链接地址</th>
        <th>是否外链</th>
        <th>是否显示</th>
        <th>操作</th>
    </tr>
    <tbody>
    {% for r in records -%}
    <tr>
        <td> <input type="checkbox" name=""  lay-skin="primary"> </td>
        <td>{{r.id }}</td>
        <td>{{r.parent_id | menu_name}}</td>
        <td>{{r.name }}</td>
        <td>{% if r.level_id == 0 %}一级菜单{% else %}二级菜单{% endif %}</td>
        <td>{{r.state | state_name}}</td>
        <td>{{r.url }}</td>
        <td>{{r.is_blank|yes_no}}</td>
        <td>{{r.is_show|yes_no}}</td>
        <td class="td-manage"> {{option::update(id=r.id, height=550)}} | {{option::delete(id=r.id)}} </td>
    </tr>
    {% endfor -%}
    </tbody>
</thead>
</table>
{% endblock content -%}
